﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MCB.Trading.Test.Market;
using System.Diagnostics;
using MCB.Trading.Generic;

namespace MCB.Trading.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            MatchingEngine<string, Order<FoodItem>, FoodItem> market = 
                new MatchingEngine<string, Order<FoodItem>, FoodItem>();
            market.AddAlgorithm(new StandardAlgorithm<string, Order<FoodItem>, FoodItem>());

            market.Matched += (sender, order) =>
            {
                Debug.WriteLine("Matched order " + order.Id + " val:" + order.Value + " tob:" + order.TopOfBook.ToString());
            };

            FoodItem banana = new FoodItem() { Name = "banana" };
            FoodItem orange = new FoodItem() { Name = "orange" };
            FoodItem peach = new FoodItem() { Name = "peach" };

            market.Add(new Order<FoodItem> (SideEnum.Buy, peach, 11));
            market.Add(new Order<FoodItem>(SideEnum.Buy, peach, 41));
            market.Add(new Order<FoodItem>(SideEnum.Sell, peach, 500));
            market.Add(new Order<FoodItem>(SideEnum.Buy, peach, 55));

        }
    }
}
